//
//  YLRealNameInformationViewController.m
//  YLFinanceService
//
//  Created by she1323 on 2017/9/2.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "YLRealNameInformationViewController.h"
#import "YLRealNameInformationViewModel.h"
#import "YLTitleIamgeListCell.h"
#import "YLGlobeHeader.h"
@interface YLRealNameInformationViewController ()
@property (nonatomic, strong) YLRealNameInformationViewModel *viewModel;
@end

@implementation YLRealNameInformationViewController

- (YLRealNameInformationViewModel *)viewModel
{
    if (!_viewModel) {
        _viewModel = [[YLRealNameInformationViewModel alloc] init];
    }
    return _viewModel;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"实名信息";
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([YLTitleIamgeListCell class]) bundle:nil] forCellReuseIdentifier:[YLTitleIamgeListCell cellID]];

}

- (instancetype)init
{
    return [self initWithStyle:UITableViewStyleGrouped];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return self.viewModel.groups.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    YLIconTitleModelGroup *group = self.viewModel.groups[section];
    return group.models.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    YLIconTitleModelGroup *group = self.viewModel.groups[indexPath.section];
    YLIconTitleNoArrowModel *model = group.models[indexPath.row];
    YLTitleIamgeListCell *cell = [tableView dequeueReusableCellWithIdentifier:[YLTitleIamgeListCell cellID]];
    cell.iconTitleModel = model;
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return YLScreenW * 24 / 750.0;
}



- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return YLScreenW * 93 / 750.0;;
}



@end
